package com.vue3.blog.common.util;

import org.springframework.util.DigestUtils;

/**
 * @author Mr.小朱同学
 * @version 1.0.0
 * @date 2025/6/30 12:25
 * @description MD5工具类
 */
public class MD5Util {
    private static final int HASH_ITERATIONS = 5;

    /**
     * 加密
     */
    public static String md5(String text) {
        for (int i = 0; i < HASH_ITERATIONS; i++) {
            text = DigestUtils.md5DigestAsHex(text.getBytes());
        }
        return text;
    }

    public static void main(String[] args) {
        System.out.println(md5("123456"));
    }
}